    <extend name="base"/>
    <block name="main">
		<ul class="nav nav-pills nav-justified nav-tab">
		  <li><a href="{:U('Admin/Index/photoalbummanage?op=album')}">相册</a></li>
		  <li class="active"><a href="{:U('Admin/Index/photoalbummanage?op=theme')}">主题</a></li>
		</ul>
		<form action="{:U('Admin/Index/photoalbummanage?op=themesetting&do=themeupdate')}&themeid={$themeid}"  enctype="multipart/form-data" method="post">
		

<div class="panel panel-default">
			<div class="panel-heading">添加项目分类</div>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane  active" style="padding:20px;">
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">主题名称：</span>
                             
									<input type="text" value="{$data[0][themename]}" name="themename" class="form-control"/>
                                </div>
                               
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">主题图片：</span>
                             
						<div id="preview">
                        	<img id="imghead" border="0" src="{$data[0][photoframeimgurl]}" width="700" height="400" onclick="$('#previewImg').click();">
                     	</div>         
                   	 	<input type="file" onchange="previewImage(this)" name="themefile" style="display: none;" id="previewImg">
                          </div>
                               <span>点击图片上传图片</span>
                           </div>
 						<input type="submit" class="btn btn-primary" value="修改">
    <script>
      //图片上传预览    IE是用了滤镜。
        function previewImage(file)
        {
          var MAXWIDTH  = 90; 
          var MAXHEIGHT = 90;
          var div = document.getElementById('preview');
          if (file.files && file.files[0])
          {
              div.innerHTML ='<img id=imghead onclick=$("#previewImg").click()>';
              var img = document.getElementById('imghead');
              img.onload = function(){
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width  =  rect.width;
                img.height =  rect.height;
//                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top+'px';
              }
              var reader = new FileReader();
              reader.onload = function(evt){img.src = evt.target.result;}
              reader.readAsDataURL(file.files[0]);
          }
          else //兼容IE
          {
            var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
            div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
          }
        }
    </script>
                      <!---->
					</div>
				</div>
			</div>
		</div>
				</form>
		</block>